const express = require('express')
const router = express.Router()
const { getSceneryBarChartData, getSceneryPieChartData, getHotelBarChartData, getHotelPieChartData, getRestaurantBarChartData, getCityLineChartData } = require('../../controller/apis/ChartController')

// 导入JWT拦截中间件
const checkTokenMiddleware = require('../../middleware/checkTokenMiddleware')

// 景点
// 获取景点类型柱状图所需数据
router.get('/chart/scenery/bar', checkTokenMiddleware, getSceneryBarChartData)

// 获取景点等级饼图所需数据
router.get('/chart/scenery/pie', checkTokenMiddleware, getSceneryPieChartData)

// 酒店
// 获取酒店类型柱状图所需数据
router.get('/chart/hotel/bar', checkTokenMiddleware, getHotelBarChartData)

// 获取酒店等级饼图所需数据
router.get('/chart/hotel/pie', checkTokenMiddleware, getHotelPieChartData)

// 餐厅
// 获取餐厅类型柱状图所需数据
router.get('/chart/restaurant/bar', checkTokenMiddleware, getRestaurantBarChartData)

// 获取各城市景点、酒店、餐厅平均价格折线图
router.get('/chart/city/line', checkTokenMiddleware, getCityLineChartData)

module.exports = router